<template>
  <tab>
    <tab-item 
    v-for="(value,index) in tabItems" 
    :selected='num==index' 
    @on-item-click="onItemClick" 
    :key="value">{{value}}</tab-item>
  </tab>
</template>

<script>
import { Tab, TabItem } from 'vux'
export default {
  components: {
    Tab,
    TabItem
  },
  data () {
    return {
      num: this.$route.query.num,
      tabItems: ['全部', '待付款', '待发货', '待收货', '待评价']
    }
  },
  methods: {
    onItemClick (index) {
    	this.$store.commit('changeOrderListData',index);     
    }
  },
  created(){ 	
	  this.$store.commit('changeOrderListData',Number(this.num));
  }
}
</script>

<style>

</style>